/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author nisarg
 */
public class chess2 {
    public static void main(String[] args) {
        
        int[] horse = new int[40];
        int[] bishop = new int[40];
        int[] king = new int[40];
        int[] rook = new int[40];
        int[] queen = new int[400];
        int[] pawn = new int[40];
        
        int c_a=5,c_b=4;
        int x=c_a,y=c_b;
        
            
        
        
        /* HORSE LOGIC */
        int th=0;
            horse[th++] = (x+1)*10+(y+2);
            horse[th++] = (x+1)*10+(y-2);
            horse[th++] = (x+2)*10+(y+1);
            horse[th++] = (x+2)*10+(y-1);
            
            horse[th++] = (x-1)*10+(y+2);
            horse[th++] = (x-1)*10+(y-2);
            horse[th++] = (x-2)*10+(y+1);
            horse[th++] = (x-2)*10+(y-1);
            
        /* BISHOP LOGIC && ROOK LOGIC*/
            int tb = 0;
            int tr = 0;
            for(int i=1;i<9;i++) {
                
                bishop[tb++] = (x+i)*10 + (y+i);
                bishop[tb++] = (x+i)*10 + (y-i);
                bishop[tb++] = (x-i)*10 + (y+i);
                bishop[tb++] = (x-i)*10 + (y-i);
                
                
                //ROOK
                if(x != i) {
                    rook[tr++] = x*10 + (i);
                }
                if(y != i) {
                    rook[tr++] = i*10 + (y);
                }
            }
            
            /* KING LOGIC */
            
            int tk = 0;
            king[tk++] = (x+1)*10 + (y);
            king[tk++] = (x-1)*10 + (y);
            king[tk++] = (x)*10 + (y+1);
            king[tk++] = (x)*10 + (y-1);
            king[tk++] = (x+1)*10 + (y+1);
            king[tk++] = (x+1)*10 + (y-1);
            king[tk++] = (x-1)*10 + (y+1);
            king[tk++] = (x-1)*10 + (y-1);
            
            /* QUEEN LOGIC */
         
            int tq = 0;
            //int tq = 0;
            for(int i=1;i<9;i++) {
                
                queen[tq++] = (x+i)*10 + (y+i);
                queen[tq++] = (x+i)*10 + (y-i);
                queen[tq++] = (x-i)*10 + (y+i);
                queen[tq++] = (x-i)*10 + (y-i);
                
                if(x != i) {
                    queen[tq++] = x*10 + (i);
                }
                if(y != i) {
                    queen[tq++] = i*10 + (y);
                }
            }
        
            /* PAWN LOGIC */
                int tp = 0;
                pawn[tp++] = (x+1)*10 + (y+1);
                pawn[tp++] = (x-1)*10 + (y+1);
                pawn[tp++] = (x)*10 + (y+1);
                
                for(int i=0;i<40;i++) {
                    if(horse[i] < 88 && horse[i] > 11)
                    if(horse[i]!='\0') System.out.println("h." + horse[i]);
                }
                System.out.println("\n\n");
                for(int i=0;i<40;i++) {
                    if(king[i] < 88 && king[i] > 11)
                    if(king[i]!='\0') System.out.println("k." + king[i]);
                }
                System.out.println("\n\n");
                for(int i=0;i<40;i++) {
                    if(rook[i] < 88 && rook[i] > 11)
                    if(rook[i]!='\0') System.out.println("r." + rook[i]);
                }
                System.out.println("\n\n");
                int count = 0;
                for(int i=0;i<40;i++) {
                    
                    if(queen[i] < 89 && queen[i] > 11)
                    if(queen[i]!='\0') {
                        System.out.println("q." + queen[i] + "   " + count);
                        count++;
                    }
                }
                System.out.println("\n\n");
                for(int i=0;i<40;i++) {
                    if(pawn[i] < 89 && pawn[i] > 11)
                    if(pawn[i]!='\0') System.out.println("p." + pawn[i]);
                }
                System.out.println("\n\n");
                for(int i=0;i<40;i++) {
                    if(bishop[i] < 88 && bishop[i] > 11)
                    if(bishop[i]!='\0') System.out.println("b." + bishop[i]);
                }
                System.out.println("\n\n");
                
                
    }
    
}

